package examlab;

public class MyObject {

    //    Integer[] mt;
    int[] mt;

    MyObject(int... ia) {
        mt = ia;
    }

    @Override
    public String toString() {
        String ts = "[";
        for (Integer i : mt) {
            ts = ts + i + " ";
        }
        ts = ts + "]";
        return ts;
    }

    @Override
    public int hashCode() {
        int hc = 0;
        for (Integer i : mt) {
            hc = hc + (i * 2);
        }
        return hc;
    }

    static volatile java.io.PrintStream s = System.out;

    public static void main(String[] args) {
        Runnable r1 = new Runnable() {

            @Override
            public void run() {
                synchronized (s) {
                    System.out.print("SCJP-1 ");
                    System.out.print("SCJP-2 ");
                    System.out.print("SCJP-3 ");
                }
            }
        };

        Runnable r2 = new Runnable() {

            @Override
            public void run() {
                synchronized (s) {
                    System.out.print("SCEA-1 ");
                    System.out.print("SCEA-2 ");
                    System.out.print("SCEA-3 ");
                }
            }
        };

        r1.run();
        r2.run();
    }

}
